package com.iss.okair.db.mapper;

import com.iss.okair.db.entity.AssetsCar;
import com.iss.okair.db.entity.Assetstrans;
import com.iss.okair.db.mapper.sql.AssetsCarSQL;
import com.iss.okair.db.model.AssetsCarModel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import java.util.List;

public interface AssetsCarMapper {

    @SelectProvider(type = AssetsCarSQL.class,method = "find")
    List<AssetsCar> select(AssetsCarModel model);

    //添加元素来自于AssetsCar
    @Insert("insert into assets_car values(#{id},#{assetscode},#{assetstype},#{namecn},#{engineinfo},#{carbrand},#{carmodel},#{powertype},#{sitcount},#{autotrans},#{comment},NOW(),#{createuser})")
    int add(AssetsCar car);
    //查询全部记录的方法

    @Select("select count(*) from assets_car")
    int countALL();
    //修改的方法
    @UpdateProvider(type = AssetsCarSQL.class,method = "update")
    int update(AssetsCar car);



}
